package com.jjy.admin.service.task.impl;

import com.jjy.admin.domain.TaskJob;
import com.jjy.admin.domain.TaskJobDTO;
import com.jjy.admin.mapper.JobMapper;
import com.jjy.admin.mapper.TaskJobMapper;
import com.jjy.admin.service.task.TaskService;
import com.jjy.common.domain.PageResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;

@Service
public class TaskServiceImpl implements TaskService {
    @Resource
    private TaskJobMapper taskJobMapper;

    @Override
    public PageResult<TaskJob> page(TaskJobDTO taskJob) {
       return taskJobMapper.selectPage(taskJob);
    }

    @Override
    public int deleteTasksByIds(Long[] jobId) {
        return taskJobMapper.deleteBatchIds(Arrays.asList(jobId));
    }
}
